***Replication Materials for "Too Late to Apologize? Collateral Damage, Post-Harm Compensation, and Insurgent Violence in Iraq"***
***Created By Daniel Silverman, Updated 3-29-20***
***Use "CP_Data_Final_Half-Year -- 3-29-20.dta" unless other dataset indicated***

***Manuscript Results***

*Descriptive Plots (Figure 1), using "CP_Data_Final_Weekly -- 3-29-20.dta"*
//Note: the top values of each type of compensation are truncated in this figure to display the remaining variation more clearly//
gen spentcptotal2 = spentcptotal
gen spentruzicka2 = spentruzicka
replace spentcptotal2 = 250000 if spentcptotal2 > 250000
replace spentruzicka2 = 50000 if spentruzicka2 > 50000
//Code to create graphs//
tsline SIGACT, graphregion(color(white)) plotregion(lcolor(black)) title("Insurgent Attacks") ytitle("Number of Incidents") xtitle("Week")
*save as "Attacks_Trend.gph"
tsline coalitioncc, graphregion(color(white)) plotregion(lcolor(black)) title("Collateral Damage") ytitle("Number of Incidents") xtitle("Week")
*save as "Damage_Trend.gph"
tsline spentcptotal2, graphregion(color(white)) plotregion(lcolor(black)) title("Condolence Payments") ytitle("Thousands of Dollars") xtitle("Week") ylabel(0 "0" 50000 "50" 100000 "100" 150000 "150" 200000 "200" 250000 "250")
*save as "Condolence_Trend.gph"
tsline spentruzicka2, graphregion(color(white)) plotregion(lcolor(black)) title("Ruzicka Payments") ytitle("Thousands of Dollars") xtitle("Week") ylabel(0 "0" 10000 "10" 20000 "20" 30000 "30" 40000 "40" 50000 "50")
*save as "Ruzicka_Trend.gph"
graph combine "Attacks_Trend.gph" "Damage_Trend.gph" "Condolence_Trend.gph" "Ruzicka_Trend.gph", graphregion(color(white))

*DGP Modeling (Table 1)*
eststo clear
eststo: quietly areg d.p_spentcptotal l.d.p_S1 d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka dis_usprt d.a_of_batt d.pop_den d.pct_urban cmoc halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
eststo: quietly areg d.p_spentruzicka l.d.p_S1 d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka dis_usprt d.a_of_batt d.pop_den d.pct_urban cmoc halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
esttab using CPTab1.tex, b(2) se(2) r2(2) label noomit nogaps star(* 0.10 ** 0.05 *** 0.01) indicate("Half-Year F.E. = halfyr*" "Sunni * Half-Year =  su_*") ///
  title(Predictors of Post-Harm Civilian Compensation in Iraq, 2004-08\label{tab1})

*Base Results (Table 2)*
eststo clear
eststo: quietly areg d.p_S1 d.p_spentcptotal d.p_spentruzicka halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
eststo: quietly areg d.p_S1 d.p_spentcptotal d.p_spentruzicka d.coalitioncc d.insurgentcc halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
eststo: quietly areg d.p_S1 d.p_spentcptotal d.p_spentruzicka d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
eststo: quietly areg d.p_S1 d.p_spentcptotal d.p_spentruzicka d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka d.a_of_batt cmoc dis_usprt halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
esttab using CPTab2.tex, b(2) se(2) r2(2) label noomit nogaps star(* 0.10 ** 0.05 *** 0.01) indicate("Half-Year F.E. = halfyr*" "Sunni * Half-Year =  su_*") ///
  title(The Effect of Post-Harm Civilian Compensation on SIGACTs per Half Year\label{tab2})

***Appendix Results***

*Harm*Compensation Interactions (Figure A1)*
areg d.p_S1 c.diffp_spentcptotal d.p_spentruzicka c.diffcoalitioncc c.diffp_spentcptotal#c.diffcoalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka d.a_of_batt cmoc dis_usprt halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
margins, dydx(diffp_spentcptotal) at(diffcoalitioncc=(-5(1)5))
marginsplot, yline(0) ytitle("Effect of Condolence Spending") xtitle("Change in Coalition Collateral Damage") title("Condolence Spending") graphregion(color(white)) plotregion(lcolor(black))
*save as "Harm_Condolence.gph"
areg d.p_S1 d.p_spentcptotal c.diffp_spentruzicka c.diffcoalitioncc c.diffp_spentruzicka#c.diffcoalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka d.a_of_batt cmoc dis_usprt halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
margins, dydx(diffp_spentruzicka) at(diffcoalitioncc=(-5(1)5))
marginsplot, ylabel(-3(1)1) yline(0) ytitle("Effect of Ruzicka Spending") xtitle("Change in Coalition Collateral Damage") title("Ruzicka Spending") graphregion(color(white)) plotregion(lcolor(black))
*save as "Harm_Ruzicka.gph"
graph combine "Harm_Condolence.gph" "Harm_Ruzicka.gph", graphregion(color(white))

*DGP Robustness (Table A1)*
eststo clear
eststo: quietly reg p_spentcptotal l.p_S1 coalitioncc insurgentcc p_spentcerpsmall_noncp p_spentusaid_nonruzicka dis_usprt a_of_batt pop_den pct_urban cmoc halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid)
eststo: quietly reg p_spentruzicka l.p_S1 coalitioncc insurgentcc p_spentcerpsmall_noncp p_spentusaid_nonruzicka dis_usprt a_of_batt pop_den pct_urban cmoc halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid)
eststo: quietly areg p_spentcptotal l.p_S1 coalitioncc insurgentcc p_spentcerpsmall_noncp p_spentusaid_nonruzicka dis_usprt a_of_batt pop_den pct_urban cmoc halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
eststo: quietly areg p_spentruzicka l.p_S1 coalitioncc insurgentcc p_spentcerpsmall_noncp p_spentusaid_nonruzicka dis_usprt a_of_batt pop_den pct_urban cmoc halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
esttab using CPTabA1.tex, b(2) se(2) r2(2) label noomit nogaps star(* 0.10 ** 0.05 *** 0.01) indicate("Half-Year F.E. = halfyr*" "Sunni * Half-Year =  su_*") ///
  title(Predictors of Post-Harm Civilian Compensation in Iraq, 2004-08\label{taba1})

*Correlation Matrix (Table A2)*  
corrtex p_S1 p_spentcptotal p_spentruzicka coalitioncc insurgentcc p_spentcerpsmall_noncp p_spentusaid_nonruzicka a_of_batt cmoc dis_usprt, file(corrmatrix) dig(3)

*Endogeneity Checks (Table A3)*
eststo clear
eststo: quietly areg l.d.p_S1 d.p_spentcptotal d.p_spentruzicka d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka d.a_of_batt cmoc dis_usprt halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
eststo: quietly areg d.p_spentcptotal d.p_spentruzicka f.d.p_S1 l.d.p_S1 d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka d.a_of_batt cmoc dis_usprt halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
eststo: quietly areg d.p_spentruzicka d.p_spentcptotal f.d.p_S1 l.d.p_S1 d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka d.a_of_batt cmoc dis_usprt halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
esttab using CPTabA3.tex, b(2) se(2) r2(2) label noomit nogaps star(* 0.10 ** 0.05 *** 0.01) indicate("Half-Year F.E. = halfyr*" "Sunni * Half-Year =  su_*") ///
  title(Tests for Endogeneity and Anticipation Bias\label{taba3})

*Additional Covariates (Table A4)*
eststo clear
eststo: quietly areg d.p_S1 d.p_spentcptotal d.p_spentruzicka d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka d.a_of_batt cmoc dis_usprt halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
eststo: quietly areg d.p_S1 d.p_spentcptotal d.p_spentruzicka d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka d.a_of_batt cmoc dis_usprt halfyr2-halfyr10 su_vh2-su_vh10 d.p_ms_small_non_cerp_recon d.p_ms_large_non_cerp_recon [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
eststo: quietly areg d.p_S1 d.p_spentcptotal d.p_spentruzicka d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka d.a_of_batt cmoc dis_usprt halfyr2-halfyr10 su_vh2-su_vh10 d.p_ms_small_non_cerp_recon d.p_ms_large_non_cerp_recon l.d.p_S1 l.d.coalitioncc l.d.insurgentcc l.d.a_of_batt [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
eststo: quietly areg d.p_S1 d.p_spentcptotal d.p_spentruzicka d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka d.a_of_batt cmoc dis_usprt halfyr2-halfyr10 su_vh2-su_vh10 d.p_ms_small_non_cerp_recon d.p_ms_large_non_cerp_recon l.d.p_S1 l.d.coalitioncc l.d.insurgentcc l.d.a_of_batt d.urate d.pop_den d.pct_urban [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
eststo: quietly areg d.p_S1 d.p_spentcptotal d.p_spentruzicka d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka d.a_of_batt cmoc dis_usprt halfyr2-halfyr10 su_vh2-su_vh10 d.p_ms_small_non_cerp_recon d.p_ms_large_non_cerp_recon l.d.p_S1 l.d.coalitioncc l.d.insurgentcc l.d.a_of_batt d.urate d.pop_den d.pct_urban d.sectariancc d.unknowncc [aw=POP] if district~="Karkh", cluster(districtid) absorb(districtid)
esttab using CPTabA4.tex, b(2) se(2) r2(2) label noomit nogaps star(* 0.10 ** 0.05 *** 0.01) indicate("Half-Year F.E. = halfyr*" "Sunni * Half-Year =  su_*") ///
  title(Replication of Base Results with Additional Covariates\label{taba4})

*No Fixed Effects (Table A5)*
eststo clear
eststo: quietly reg d.p_S1 d.p_spentcptotal d.p_spentruzicka halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid)
eststo: quietly reg d.p_S1 d.p_spentcptotal d.p_spentruzicka d.coalitioncc d.insurgentcc halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid)
eststo: quietly reg d.p_S1 d.p_spentcptotal d.p_spentruzicka d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid)
eststo: quietly reg d.p_S1 d.p_spentcptotal d.p_spentruzicka d.coalitioncc d.insurgentcc d.p_spentcerpsmall_noncp d.p_spentusaid_nonruzicka d.a_of_batt cmoc dis_usprt halfyr2-halfyr10 su_vh2-su_vh10 [aw=POP] if district~="Karkh", cluster(districtid)
esttab using CPTabA5.tex, b(2) se(2) r2(2) label noomit nogaps star(* 0.10 ** 0.05 *** 0.01) indicate("Half-Year F.E. = halfyr*" "Sunni * Half-Year =  su_*") ///
  title(Replication of Base Results without District Fixed Effects\label{tab5})

*Monthly Replication (Table A6), using "CP_Data_Final_Monthly -- 3-29-20.dta"*
eststo clear
eststo: quietly areg d.p_S1 l.d.p_spentcptotal l.d.p_spentruzicka l.d.coalitioncc l.d.insurgentcc l.d.p_spentcerpsmall_noncp l.d.p_spentusaid_nonruzicka l.d.a_of_batt l.dis_usprt l.cmoc halfyr1-halfyr11 su_vh1-su_vh11 [aw=POP] if districtid~=69, cluster(districtid) absorb(districtid)
eststo: quietly areg d.p_S1 l.d.p_spentcptotal l.d.p_spentruzicka l.d.coalitioncc l.d.insurgentcc l.d.p_spentcerpsmall_noncp l.d.p_spentusaid_nonruzicka l.d.a_of_batt l.dis_usprt l.cmoc halfyr1-halfyr11 su_vh1-su_vh11 d.p_spentrecon_noncerp l.d.p_S1 d.urate d.pop_den d.pct_urban d.sectariancc d.unknowncc [aw=POP] if districtid~=69, cluster(districtid) absorb(districtid)
eststo: quietly areg d.p_S1 l.d.p_spentcpall l.d.coalitioncc l.d.insurgentcc l.d.p_spentcerpsmall_noncp l.d.p_spentusaid_nonruzicka l.d.a_of_batt l.dis_usprt l.cmoc halfyr1-halfyr11 su_vh1-su_vh11 [aw=POP] if districtid~=69, cluster(districtid) absorb(districtid)
eststo: quietly areg d.p_S1 l.d.p_spentcpall l.d.coalitioncc l.d.insurgentcc l.d.p_spentcerpsmall_noncp l.d.p_spentusaid_nonruzicka l.d.a_of_batt l.dis_usprt l.cmoc halfyr1-halfyr11 su_vh1-su_vh11 d.p_spentrecon_noncerp l.d.p_S1 d.urate d.pop_den d.pct_urban d.sectariancc d.unknowncc [aw=POP] if districtid~=69, cluster(districtid) absorb(districtid)
esttab using CPTabA6.tex, b(2) se(2) r2(2) label noomit nogaps star(* 0.10 ** 0.05 *** 0.01) indicate("Half-Year F.E. = halfyr*" "Sunni * Half-Year =  su_*") ///
  title(Replication of Base Results on Monthly Data\label{taba6})

*Weekly Replication (Table A7), using "CP_Data_Final_Weekly -- 3-29-20.dta"*
eststo clear
eststo: quietly areg d.p_S1 l.d.p_spentcptotal l2.d.p_spentcptotal l3.d.p_spentcptotal l4.d.p_spentcptotal l.d.p_spentruzicka l2.d.p_spentruzicka l3.d.p_spentruzicka l4.d.p_spentruzicka l.d.coalitioncc l.d.insurgentcc l.d.p_spentcerpsmall_noncp l.d.p_spentusaid_nonruzicka l.d.a_of_batt l.dis_usprt l.cmoc halfyr1-halfyr11 su_vh1-su_vh11 [aw=POP] if district_id~=69, cluster(district_id) absorb(district_id)
eststo: quietly areg d.p_S1 l.d.p_spentcptotal l2.d.p_spentcptotal l3.d.p_spentcptotal l4.d.p_spentcptotal l.d.p_spentruzicka l2.d.p_spentruzicka l3.d.p_spentruzicka l4.d.p_spentruzicka l.d.coalitioncc l.d.insurgentcc l.d.p_spentcerpsmall_noncp l.d.p_spentusaid_nonruzicka l.d.a_of_batt l.dis_usprt l.cmoc halfyr1-halfyr11 su_vh1-su_vh11 d.p_spentrecon_noncerp l.d.p_S1 d.urate d.pop_den d.pct_urban d.sectariancc d.unknowncc [aw=POP] if district_id~=69, cluster(district_id) absorb(district_id)
eststo: quietly areg d.p_S1 l.d.p_spentcpall l2.d.p_spentcpall l3.d.p_spentcpall l4.d.p_spentcpall l.d.coalitioncc l.d.insurgentcc l.d.p_spentcerpsmall_noncp l.d.p_spentusaid_nonruzicka l.d.a_of_batt l.dis_usprt l.cmoc halfyr1-halfyr11 su_vh1-su_vh11 [aw=POP] if district_id~=69, cluster(district_id) absorb(district_id)
eststo: quietly areg d.p_S1 l.d.p_spentcpall l2.d.p_spentcpall l3.d.p_spentcpall l4.d.p_spentcpall l.d.coalitioncc l.d.insurgentcc l.d.p_spentcerpsmall_noncp l.d.p_spentusaid_nonruzicka l.d.a_of_batt l.dis_usprt l.cmoc halfyr1-halfyr11 su_vh1-su_vh11 d.p_spentrecon_noncerp l.d.p_S1 d.urate d.pop_den d.pct_urban d.sectariancc d.unknowncc [aw=POP] if district_id~=69, cluster(district_id) absorb(district_id)
esttab using CPTabA7.tex, b(2) se(2) r2(2) label noomit nogaps star(* 0.10 ** 0.05 *** 0.01) indicate("Half-Year F.E. = halfyr*" "Sunni * Half-Year =  su_*") ///
  title(Replication of Base Results on Weekly Data\label{taba7})

*Joint Weekly Effects (Table A8), using "CP_Data_Final_Weekly -- 3-29-20.dta"*
quietly areg d.p_S1 l.d.p_spentcptotal l2.d.p_spentcptotal l3.d.p_spentcptotal l4.d.p_spentcptotal l.d.p_spentruzicka l2.d.p_spentruzicka l3.d.p_spentruzicka l4.d.p_spentruzicka l.d.coalitioncc l.d.insurgentcc l.d.p_spentcerpsmall_noncp l.d.p_spentusaid_nonruzicka l.d.a_of_batt l.dis_usprt l.cmoc halfyr1-halfyr11 su_vh1-su_vh11 [aw=POP] if district_id~=69, cluster(district_id) absorb(district_id)
lincom l.d.p_spentcptotal + l2.d.p_spentcptotal + l3.d.p_spentcptotal + l4.d.p_spentcptotal
lincom l.d.p_spentruzicka + l2.d.p_spentruzicka + l3.d.p_spentruzicka + l4.d.p_spentruzicka
areg d.p_S1 l.d.p_spentcpall l2.d.p_spentcpall l3.d.p_spentcpall l4.d.p_spentcpall l.d.coalitioncc l.d.insurgentcc l.d.p_spentcerpsmall_noncp l.d.p_spentusaid_nonruzicka l.d.a_of_batt l.dis_usprt l.cmoc halfyr1-halfyr11 su_vh1-su_vh11 [aw=POP] if district_id~=69, cluster(district_id) absorb(district_id)
lincom l.d.p_spentcpall + l2.d.p_spentcpall + l3.d.p_spentcpall + l4.d.p_spentcpall
